﻿cmake_minimum_required (VERSION 3.26)

# INCLUDE 3RD PARTY LIBRARIES
include("${CMAKE_SOURCE_DIR}/Scripts/FetchLibraries.cmake")

file(GLOB_RECURSE SUBDIRECTORIES "${CMAKE_SOURCE_DIR}/Source/EditorApplication/*.h"  "${CMAKE_SOURCE_DIR}/Source/EditorApplication/*.cpp" )
source_group("EditorApplication" "${CMAKE_SOURCE_DIR}/Source/EditorApplication" $"{SUBDIRECTORIES}")
add_executable ("EditorApplication" main.cpp ${SUBDIRECTORIES})

target_include_directories("EditorApplication" PRIVATE "${CMAKE_SOURCE_DIR}/Source")

target_link_libraries("EditorApplication" PRIVATE "Runtime")

if (stbi_POPULATED)
	target_include_directories("EditorApplication" PRIVATE "${stbi_SOURCE_DIR}")
	target_compile_definitions("EditorApplication" PUBLIC STB_IMAGE_IMPLEMENTATION=1)
endif()


if (CMAKE_BUILD_TYPE STREQUAL "Debug")
	target_compile_definitions("EditorApplication" PUBLIC TUTORIAL_DEBUG)
elseif (CMAKE_BUILD_TYPE STREQUAL "Release")
	target_compile_definitions("EditorApplication" PUBLIC TUTORIAL_RELEASE)
endif()

# MACRO DEFINITIONS
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
	target_compile_definitions("EditorApplication" PUBLIC EDITOR_API=__declspec\(dllexport\))
else()
	message(FATAL_ERROR "Unsupported Compiler")
endif()
